#pragma once
#include "ImageWnd.h"
#include "WavTipCtrl.h" 
#include "ComboListCtrl.h"
// CMenuTableDlg dialog
class CbackManageDlg;
class CMenuTableDlg : public CMaxDisplayDlg
{
	DECLARE_DYNAMIC(CMenuTableDlg)

public:
	CMenuTableDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CMenuTableDlg();
	virtual BOOL PreTranslateMessage(MSG* pMsg);

// Dialog Data
	enum { IDD = IDD_DIALOG_MENU };
public:
	u32				m_nTypeNo;
	u32				m_nUnitNo;	
	CString			m_nTypeList[50];
	CString			m_nUnitList[50];
protected:
	CString   			m_nLastPrice;   
	CString   			m_nLastAbbr;
	CImageWnd		m_wndImage;
	CWavTipCtrl 		m_tooltip;
	u32				m_nTxCMD;
	u32				m_nRxErr;
protected:	
	void TxAddNewMenu(MenuType *pmenu);
	void TxEditExistMenu(MenuType *pmenu);
	void TxDelelteExistMenu(MenuType *pmenu);
	void RxAddNewMenu(CMDRes *pRet);
	void RxEditExistMenu(CMDRes *pRet);
	void RxDelelteExistMenu(CMDRes *pRet);
	void DisplayErrorState(void);
	void GetControllerInfo(MenuType *pmenu);
	void SetControllerInfo(MenuType *pmenu);
	void ClearControllerInfo(void);	
	void RxAddNewXML(MenuType *pmenu);
	void RxEditExistXML(MenuType *pmenu);
	void RxDelelteExistXML(MenuType *pmenu);

protected:
	CString				m_nName;
	CString				m_nIndex;
	CComboBox			m_nType;
	CString				m_nAbbr;	/*Abbreviation*/
	CComboBox			m_nUnit;
	CString				m_nPrice;	
	CString				m_nList;
	CString				m_nIntro;
	BOOL				m_nPackage;
	CString 				m_nImagePath;
	CString 				m_nRemark;	
	HANDLE        			m_hEvent;
	CComboListCtrl		m_ListCtrl;
	u32					m_ListItem;
protected:
	virtual BOOL OnInitDialog();
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	afx_msg LRESULT OnNetMessage(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedBtnMenuIamge();
public:
	afx_msg void OnBnClickedBtnMenuSearch();
public:
	afx_msg void OnBnClickedBtnMenuEdit();
public:
	afx_msg void OnBnClickedBtnMenuAdd();
public:
	afx_msg void OnBnClickedBtnMenuDelete();
public:
	afx_msg void OnBnClickedBtnMenuFile();
public:
	afx_msg void OnBnClickedBtnMenuOk();
public:
	afx_msg void OnBnClickedBtnMenuCancel();
public:
	afx_msg void OnEnChangeEditMenuPrice();
public:
	afx_msg void OnEnChangeEditMenuAbbr();	
public:
	afx_msg void OnEnKillfocusEditMenuIndex();
public:
	afx_msg void OnBnClickedRadioMenuPackage();
public:
	afx_msg void OnBnClickedBtnListAdd();
public:
	afx_msg void OnBnClickedBtnListDel();	
};
